package com.biostime.springdraw.modules.sd.dao;

import java.util.ArrayList;

import com.biostime.springdraw.modules.sd.dto.DistributedAwardDto;
import com.biostime.springdraw.modules.sd.dto.WinnerDto;
import java.util.LinkedHashMap;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.biostime.springdraw.common.mybatis.MyBatisDao;
import com.biostime.springdraw.common.persistence.CrudDao;
import com.biostime.springdraw.modules.sd.entity.Award;
import com.biostime.springdraw.modules.sd.entity.Section;
import com.biostime.springdraw.modules.sd.entity.Winner;


/**
 * 中奖表Dao
 * @author king
 * @version 2016-01-18
 */
@MyBatisDao
public interface WinnerDao extends CrudDao<Winner> {
	public  ArrayList<LinkedHashMap<String,Object>> exportWinner();
	
	public List<WinnerDto> getAllWinner(String openid);

	public int getWinnerCount(Award award);

	public int findListBySection(Section section);

	public List<Winner> drawList(Winner winnerExm); 
	
	public Winner selectByWinnerid(@Param("winnerid")String winnerid);
	
	public int update(Winner winner);

	public List<DistributedAwardDto> getSectionAwards(@Param("code") String code,@Param("drawType") int drawType);
	
	public List<WinnerDto> getMyAwards(@Param("openid")String openid);
	
	public Winner getByCodeAndOpenid(@Param("shareCode")String shareCode , @Param("openid")String openid);
	
	public int updateWinnerMemberId(Winner winner);
	
	public void recoveryIntimeAward();
	
	public  DistributedAwardDto getSectionDrawAwards(@Param("code") String code , @Param("awardId") String awardId ,
			@Param("drawType") int drawType);
	
	public Winner getByOpenid(@Param("shareCode")String shareCode , @Param("openid")String openid);
}